package com.candy.bean;

/**
 * @author donglin
 * @Title:
 * @类名: Teacher
 * @date 2020/5/20
 */
public class Teacher {
    //属性
    public String strName;
    public int age;
    public int height;
    public boolean sex;
    //构造
    public Teacher() {
    }
    //this指代的就是当前对象，对在调用它，谁就是this
    public Teacher(String strName, int age, boolean sex) {
        this.strName = strName;
        this.age = age;
        this.sex = sex;
    }

    //方法
    public void  sayHi(){
        System.out.println("大家好，我叫"+strName+"我今年"+age+"岁,我是"+(sex?"男的":"女的"));
    }

    public  String  sayHi(String strName){
        String strSh;
        System.out.println("大家好，我叫"+strName);
        return strName;
    }
}
